Among the conventional image forming apparatuses, there are ones that detect the length of a medium in the medium carrying direction and carries an irregular-size medium securely at a high speed (e.g., see Patent Document 1).